import request from "@/utils/request";
export const getIndustry = () => {
  return request({
    method: "GET",
    url: "industry"
  });
};
export const getIndustryById = id => {
  return request({
    method: 'GET',
    url: `industry/${id}`
  })
};
export const editIndustry = data => {
  return request({
    method: "PUT",
    url: `industry/${data.id}`,
    data
  });
};
export const addIndustry = data => {
  return request({
    url: "industry",
    method: "POST",
    data
  });
};
export const delIndustry = id => {
  return request({
    url: `industry/${id}`,
    method: "DELETE"
  });
};
//获取数据及模糊查询
export const getCategory = params => {
  return request({
    method: 'GET',
    url: 'categories',
    params
  })
}
//根据id获取对应的数据
export const getCategoryById = id => {
  return request({
    method: 'GET',
    url: `categories/${id}`
  })
}
//添加行业
export const addCategory = data => {
  return request({
    url: "categories",
    method: "POST",
    data
  })
}
//删除行业
export const delCategory = id => {
  return request({
    url: `categories/${id}`,
    method: 'DELETE'
  })
}
//编辑行业
export const editCategory = data => {
  return request({
    url: `categories/${data.id}`,
    method: 'PUT',
    data
  })
}

//店铺权益
export const getAllRights = () => {
  return request({
    url: 'rights',
    method: 'GET'
  })
}
//编辑权益
export const editRights = data => {
  return request({
    url: `rights/${data.id}`,
    method: 'PUT',
    data
  })
}
